<!-- 
	fetchColum()方法从结果集中返回一列 
-->

<?php 

try {
	$pdo = new PDO('mysql:local=localhost; dbname=exercise', 'root', 'root');
	$sql = 'select username,password,email from user';
	$stmt = $pdo->query($sql);
	echo $stmt->fetchColumn(0).'<br>';
	echo $stmt->fetchColumn(1).'<br>';
	echo $stmt->fetchColumn(2).'<br>';

} catch (PDOException $e) {
	$e->getMessage();
}



 ?>